package com.icart.entities;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "wo_comment", schema = "ams", catalog = "")
public class WoCommentEntity {
    private long commid;
    private String oid;
    private Long custid;
    private Integer commstar;
    private String commcontent;
    private Timestamp createtime;
    private Integer isanonymous;
    private Integer isadd;
    private Integer readcnt;

    @Id
    @Column(name = "commid")
    public long getCommid() {
        return commid;
    }

    public void setCommid(long commid) {
        this.commid = commid;
    }

    @Basic
    @Column(name = "oid")
    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    @Basic
    @Column(name = "custid")
    public Long getCustid() {
        return custid;
    }

    public void setCustid(Long custid) {
        this.custid = custid;
    }

    @Basic
    @Column(name = "commstar")
    public Integer getCommstar() {
        return commstar;
    }

    public void setCommstar(Integer commstar) {
        this.commstar = commstar;
    }

    @Basic
    @Column(name = "commcontent")
    public String getCommcontent() {
        return commcontent;
    }

    public void setCommcontent(String commcontent) {
        this.commcontent = commcontent;
    }

    @Basic
    @Column(name = "createtime")
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "isanonymous")
    public Integer getIsanonymous() {
        return isanonymous;
    }

    public void setIsanonymous(Integer isanonymous) {
        this.isanonymous = isanonymous;
    }

    @Basic
    @Column(name = "isadd")
    public Integer getIsadd() {
        return isadd;
    }

    public void setIsadd(Integer isadd) {
        this.isadd = isadd;
    }

    @Basic
    @Column(name = "readcnt")
    public Integer getReadcnt() {
        return readcnt;
    }

    public void setReadcnt(Integer readcnt) {
        this.readcnt = readcnt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WoCommentEntity that = (WoCommentEntity) o;

        if (commid != that.commid) return false;
        if (oid != null ? !oid.equals(that.oid) : that.oid != null) return false;
        if (custid != null ? !custid.equals(that.custid) : that.custid != null) return false;
        if (commstar != null ? !commstar.equals(that.commstar) : that.commstar != null) return false;
        if (commcontent != null ? !commcontent.equals(that.commcontent) : that.commcontent != null) return false;
        if (createtime != null ? !createtime.equals(that.createtime) : that.createtime != null) return false;
        if (isanonymous != null ? !isanonymous.equals(that.isanonymous) : that.isanonymous != null) return false;
        if (isadd != null ? !isadd.equals(that.isadd) : that.isadd != null) return false;
        if (readcnt != null ? !readcnt.equals(that.readcnt) : that.readcnt != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (commid ^ (commid >>> 32));
        result = 31 * result + (oid != null ? oid.hashCode() : 0);
        result = 31 * result + (custid != null ? custid.hashCode() : 0);
        result = 31 * result + (commstar != null ? commstar.hashCode() : 0);
        result = 31 * result + (commcontent != null ? commcontent.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (isanonymous != null ? isanonymous.hashCode() : 0);
        result = 31 * result + (isadd != null ? isadd.hashCode() : 0);
        result = 31 * result + (readcnt != null ? readcnt.hashCode() : 0);
        return result;
    }
}
